import React, { Component } from "react";
import PubSub from "pubsub-js";
export default class Bother extends Component {
  state = { name: "brother" };
  release = () => {
    // PubSub.publish("yueyueniao", this.state);
    PubSub.publish("MY TOPIC", { name: "brother" });
    PubSub.publish("yueyueniao", { name: "brother" });
  };
  render() {
    return (
      <div>
        <h2>Bother</h2>
        <button onClick={this.release}>Bother发布</button>
      </div>
    );
  }
}
